/**
 * Created by billy on 2020/7/1.
 */
var filterList = [""]

module.exports = function (node, createAttribs, createHtml, $type)
{
	if (!node.attribs.src)
	{
		return "";
	}

	filterAttribs(node.attribs);
	return `<img${createAttribs(node, $type)}>`
}

function filterAttribs(attrribs)
{
	delete attrribs.alt;
	var srcStr = attrribs.src;
	if (srcStr.indexOf("data:image") >= 0)
	{
		return;
	}
	if (srcStr.substr(srcStr.length - 4) == ".svg")
	{
		return;
	}
	if (srcStr.indexOf("?x-oss-process") < 0)
	{
		attrribs.src = srcStr + "?x-oss-process=image/format,jpg";
	}
}